from tortoise.models import Model
from tortoise import fields


# 直播间表
class analyzed_room(Model):
    id = fields.IntField(pk=True)
    room_id = fields.TextField(description="直播间ID")
    analyzed_date = fields.TextField(description="已分析的日期")


# 频率分析表
class frequency_analysis(Model):
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    analyzed_table = fields.TextField(description="表类型")
    analyze_time = fields.TextField(description="分析时间")
    frequency = fields.TextField(description="频率统计")


# 性别分析表
class gender_analysis(Model):
    create_time = fields.TextField(description="创建时间")
    room_id = fields.TextField(description="直播间ID")
    analyzed_table = fields.TextField(description="表类型")
    analyze_time = fields.TextField(description="分析时间")
    male = fields.IntField(description="男性占比")
    woman = fields.IntField(description="女性占比")


# 用户分析表
class water_army_analysis(Model):
    user_id = fields.TextField(description="用户ID")
    user_name = fields.TextField(description="用户昵称")
    room_id = fields.TextField(description="直播间ID")
    chat_count = fields.IntField(description="消息数量")
    like_count = fields.IntField(description="点赞数量")
    enter_count = fields.IntField(description="进入数量")
    all_count = fields.IntField(description="互动总数")
    analyze_time = fields.TextField(description="分析时间")
